package edu.pku.hawk.controller.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class MOutputStreamQueue extends MQueue {

	private OutputStream outputStream;

	public MOutputStreamQueue(String queueName, OutputStream outputStream) {
		super(queueName, null);
		this.outputStream = outputStream;
	}

	public void send(InputStream is) throws IOException {
		if (is != null && this.outputStream != null) {
			int b;
			while ((b = is.read()) != -1) {
				outputStream.write(b);
			}
		}
	}

}
